import {post, postFormData} from  '../../http'
import store from '@/store'


export const addContractTemplateModel=(data)=>{
  data.fltId=store.state.user.FLT_UUID_DX_H;
  data.creator=store.state.user.USR_CODE_DX_H;
  data.dptId=store.state.user.DPTID_DX_H;
  return post('/FTKJWLHYPT/contractTemplate/add',{
    Data: {
      Parameters: {
        FTKJWLHYPT: data
      }
    }
  })
}


export const updateContractTemplateModel=(data)=>{
  data.fltId=store.state.user.FLT_UUID_DX_H;
  data.editor=store.state.user.USR_CODE_DX_H;
  data.dptId=store.state.user.DPTID_DX_H;
  return post('/FTKJWLHYPT/contractTemplate/update',{
    Data: {
      Parameters: {
        FTKJWLHYPT: data
      }
    }
  })
}

export const findContractTemplateModel=(data)=>{
  data.fltId=store.state.user.FLT_UUID_DX_H;
  data.dptId=store.state.user.DPTID_DX_H;
  return post('/FTKJWLHYPT/contractTemplate/findListPage',{
    Data: {
      Parameters: {
        FTKJWLHYPT: data
      }
    }
  })
}

//查询
export const findContractTemplateModelPage=(data)=>{
  data.fltId=store.state.user.FLT_UUID_DX_H;
  data.dptId=store.state.user.DPTID_DX_H;
  return post('/FTKJWLHYPT/contractTemplate/findListPage',{
    Data: {
      Parameters: {
        FTKJWLHYPT: data
      },
      Orderbys: {},
      PageIndex: {
        FTKJWLHYPT: data.currentPage
      },
      PageSize: {
        FTKJWLHYPT: data.pageSize
      }
    }
  })
}

export const delContractTemplateModel=(data)=>{
  data.fltId=store.state.user.FLT_UUID_DX_H;
  data.editor=store.state.user.USR_CODE_DX_H;
  data.dptId=store.state.user.DPTID_DX_H
  return post('/FTKJWLHYPT/contractTemplate/del',{
    Data: {
      Parameters: {
        FTKJWLHYPT: data
      }
    }
  })
}

export const uploadText=(file)=>{
  let formData = new FormData()
  formData.append('file', file)
  formData.append('type','contract')
  return postFormData('/FTKJWLHYPT/uploadOn',formData)
}